//
//  ZCBaseNavigationController.m
//  gamebox_qpp
//
//  Created by 赵隆杰 on 2021/12/10.
//

#import "ZCBaseNavigationController.h"

@interface ZCBaseNavigationController ()

@end

@implementation ZCBaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
//    self.navigationBar.tintColor = [UIColor blackColor];
//
//    self.navigationBar.prefersLargeTitles = NO;
//    self.navigationItem.largeTitleDisplayMode =  UINavigationItemLargeTitleDisplayModeNever;
//
//    if (@available(iOS 13.0, *)) {
//        UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
//        appearance.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:1.0];
//        appearance.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};//导航栏标题颜色
//        [appearance setLargeTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor],NSForegroundColorAttributeName,nil]];
//        self.navigationBar.standardAppearance = appearance;
//        self.navigationBar.scrollEdgeAppearance = appearance;
//    } else {
//        // Fallback on earlier versions
//        [self.navigationBar setBackgroundImage:[UIImage imageWithColor:[[UIColor whiteColor] colorWithAlphaComponent:1.0]] forBarMetrics:UIBarMetricsDefault];
//    }
    
    self.navigationBar.hidden = YES;
            
}

/**
 能拦截所有push进来的子控制器
 */
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    //    NSLog(@"pushViewController--%@",viewController);
//    NSLog(@"%@ %lu",viewController,(unsigned long)self.viewControllers.count);
    
    //如果现在push的不是栈底控制器（最先push进来的那个控制器）
    if (self.viewControllers.count > 0) {
        
        viewController.hidesBottomBarWhenPushed = YES;
    } else {
        viewController.hidesBottomBarWhenPushed = NO;
        
    }
    [super pushViewController:viewController animated:animated];
}

@end
